p = au1_params();
p.setMaxTime(500);

p.setLtsJ(30);
p.setIbAdJ(-10);

re = au1_vf(p);
        
% steps_LTS = [5:5:40];
% steps_IB = [5:5:40];
% tot_steps = length(steps_LTS)*length(steps_IB);
% step_list = [2,];
% IB_ISIs = zeros(tot_steps,100);
% LTS_ISIs = zeros(tot_steps,100);
% IB_ISI_hist = zeros(tot_steps,40);
% LTS_ISI_hist = zeros(tot_steps,40);
% 
% for J_IB = steps_IB
%     for J_LTS = steps_LTS
%         p.setLtsJ(J_LTS);
%         p.setIbAdJ(J_IB);
%         re = au1_vf(p);
%         
%         [height_IB,peak_times_IB] = findpeaks(V_mod_IB_A,'minpeakheight',0);
%         [n_IB x_IB ISIs] = histISIs(peak_times_IB,1/t(2));
%         IB_ISI_hist(k,:) = n_IB;
%         
%         [height_LTS,peak_times_LTS] = findpeaks(V_mod_LTS,'minpeakheight',0);
%         [n_LTS x_LTS ISIs] = histISIs(peak_times_LTS,1/t(2));
%         LTS_ISI_hist(k,:) = n_LTS;
%     end
% end

figure
subplot(3,1,1);
plot(p.time, reshape(re.lts.series(1,1,:),[],1));
legend('LTS');

subplot(3,1,2)
plot(p.time, [reshape(re.ib.ad.series(1,1,:),[],1) reshape(re.ib.so.series(1,1,:),[],1) reshape(re.ib.ax.series(1,1,:),[],1)]);
legend('Dendrite','Soma','Axon');

subplot(3,1,3)
plot(p.time, [reshape(re.ib.ad.series(1,5,:),[],1)]);
legend('Dendrite m');